package net.tankwar;
import javafx.application.Application;
import javafx.stage.Stage;
import net.jumpengine.Manager;
import net.jumpengine.enume.GameState;
import net.jumpengine.manager.EventManager;
import net.tankwar.event.EditInputEvent;
import net.tankwar.event.EditMouseEvent;
import net.tankwar.event.EditStateEvent;
import net.tankwar.event.IconsStateEvent;
import net.tankwar.event.InputEvent;
import net.tankwar.event.MouseEvent;
import net.tankwar.event.RunningInputEvent;
import net.tankwar.event.RunningMouseEvent;
import net.tankwar.event.RunningStateEvent;
import net.tankwar.event.StartStateEvent;

public class Main extends Application{

	@Override
	public void start(Stage stage) throws Exception {
		stage.setTitle("TankeWar:Network 坦克战争:网际 v0.1 by JumpEngine");
		
		Manager.getLog().setLevel(2);
		
		EventManager event = Manager.getEventManager();
		
		event.addInputEvent(GameState.icons,new InputEvent());
		event.addMouseEvent(GameState.icons, new MouseEvent());
		event.addStateEvent(GameState.icons, new IconsStateEvent());
		
		event.addInputEvent(GameState.start,new InputEvent());
		event.addMouseEvent(GameState.start, new MouseEvent());
		event.addStateEvent(GameState.start, new StartStateEvent());
		
		RunningStateEvent runningStateEvent = new RunningStateEvent();
		event.addInputEvent(GameState.running,new RunningInputEvent());
		event.addMouseEvent(GameState.running, new RunningMouseEvent(runningStateEvent));
		event.addStateEvent(GameState.running, runningStateEvent);
		
		event.addInputEvent(GameState.edit,new EditInputEvent());
		event.addMouseEvent(GameState.edit, new EditMouseEvent());
		event.addStateEvent(GameState.edit, new EditStateEvent());
		
		Manager.init(stage,GameState.icons,1440,792,25);
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}
